<template>
	<view class="content">
		<image class="logo" src="/static/logo.png"></image>
		<view class="text-area">
			<text class="title">page:{{getVar("yoyo")}}</text>
		</view>
		<text class="title" style="color: red;">{{ yoyo }}</text>
		<view>
			<input type="text" v-model="text" style="width: 700rpx;height: 80rpx;background-color: #007AFF;" />
			<button type="default" @click="set()">设置Vuex值</button>
			<view @click="uigo">跳转</view>
		</view>
	</view>
</template>

<script>

export default {
	data() {
		return {
			title: 'Hello',
			text:'输入内容来改变',
		};
	},
	computed:{
		...getApp().globalData.getState(['yoyo','qwe']),
	},
	onLoad() {
		this.test().asd();
	},
	methods: {
		...getApp().globalData.getMutations(['setYoyo']),
		set() {
			this.setYoyo(this.text);
			this.setVar("yoyo",this.text);
		},
		uigo(){
			uni.navigateTo({
			    url: '/pages/test/test'
			});
		}

	}
};
</script>

<style>
.content {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
}

.logo {
	height: 200rpx;
	width: 200rpx;
	margin-top: 200rpx;
	margin-left: auto;
	margin-right: auto;
	margin-bottom: 50rpx;
}

.text-area {
	display: flex;
	justify-content: center;
}

.title {
	font-size: 36rpx;
	color: #8f8f94;
}
</style>
